/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package _4_Mapper;

import _3_Object.PostCommentObject;
import _5_DB.ConnectDB;
import java.sql.CallableStatement;
import java.sql.Connection;

/**
 *
 * @author DOM
 */
public class PostCommentMapper {
    public static int pc(PostCommentObject p)
    {
        int retvl=-1;
        try
        {
            ConnectDB db = new ConnectDB();
            Connection con = db.getConnection();
            CallableStatement proc = null;
            proc = con.prepareCall("{call procGuiComment(?,?,?)}");
            
            proc.setInt(1, p.getpID());
            proc.setInt(2, p.getuID());
            proc.setString(3, p.getContents());
            
            retvl = proc.executeUpdate();
            
        }
        catch(Exception ex)  
        {
            System.out.print(ex.getMessage());
        }
        return retvl;
    }
}
